1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing documents in a browser. Still more particularly, the present invention provides a method and apparatus for selectively enabling or disabling opening of windows while processing a document.
2. Description of Related Art
The Internet, also referred to as an xe2x80x9cinternetworkxe2x80x9d, is a set of computer networks, possibly dissimilar, joined together by means of gateways that handle data transfer and the conversion of messages from the sending network to the protocols used by the receiving network (with packets if necessary). When capitalized, the term xe2x80x9cInternetxe2x80x9d refers to the collection of networks and gateways that use the TCP/IP suite of protocols.
The Internet has become a cultural fixture as a source of both information and entertainment. Many businesses are creating Internet sites as an integral part of their marketing efforts, informing consumers of the products or services offered by the business or providing other information seeking to engender brand loyalty. Many federal, state, and local government agencies are also employing Internet sites for informational purposes, particularly agencies which must interact with virtually all segments of society such as the Internal Revenue Service and secretaries of state. Providing informational guides and/or searchable databases of online public records may reduce operating costs. Further, the Internet is becoming increasingly popular as a medium for commercial transactions.
Currently, the most commonly employed method of transferring data over the Internet is to employ the World Wide Web environment, also called simply xe2x80x9cthe Webxe2x80x9d. Other Internet resources exist for transferring information, such as File Transfer Protocol (FTP) and Gopher, but have not achieved the popularity of the Web. In the Web environment, servers and clients effect data transaction using the Hypertext Transfer Protocol (HTTP), a known protocol for handling the transfer of various data files (e.g., text, still graphic images, audio, motion video, etc.). Information is formatted for presentation to a user by a standard page description language, the Hypertext Markup Language (HTML). In addition to basic presentation formatting, HTML allows developers to specify xe2x80x9clinksxe2x80x9d to other Web resources identified by a Uniform Resource Locator (URL). A URL is a special syntax identifier defining a communications path to specific information. Each logical block of information accessible to a client, called a xe2x80x9cpagexe2x80x9d or a xe2x80x9cWeb pagexe2x80x9d, is identified by a URL. The URL provides a universal, consistent method for finding and accessing this information, not necessarily for the user, but mostly for the user""s Web xe2x80x9cbrowserxe2x80x9d. A browser is a program capable of submitting a request for information identified by a URL at the client machine. Retrieval of information on the Web is generally accomplished with an HTML-compatible browser, which retrieves a web page, also referred to as a document. The Internet also is widely used to transfer applications to users using browsers. With respect to commerce on the Web, individual consumers and business use the Web to purchase various goods and services. In offering goods and services, some companies offer goods and services solely on the Web while others use the Web to extend their reach.
Users exploring the Web have discovered that the content on web pages supported by HTML document format on the Web was too limited. Users desire an ability to access applications and programs, but applications were targeted towards specific types of platforms. As a result, not everyone could access applications or programs. This deficiency has been minimized though the introduction and use of programs known as xe2x80x9cappletsxe2x80x9d, which may be embedded as objects in HTML documents on the Web. Applets are Java programs that may be transparently downloaded into a browser supporting Java along with HTML pages in which they appear. These Java programs are network and platform independent. Applets run the same way regardless of where they originate or what data processing system onto which they are loaded.
Java(trademark) is an object oriented programming language and environment focusing on defining data as objects and the methods that may be applied to those objects. Java supports only a single inheritance, meaning that each class can inherit from only one other class at any given time. Java also allows for the creation of totally abstract classes known as interfaces, which allow the defining of methods that may be shared with several classes without regard for how other classes are handling the methods. Java provides a mechanism to distribute software and extends the capabilities of a Web browser because programmers can write an applet once and the applet can be run on any Java enabled machine on the Web.
JavaScript is a cross-platform, object-oriented scripting language by Netscape Communications Corporation. JavaScript allows for the creation of applications that run over the Internet. With JavaScript, client applications may be run in a browser, such as Netscape Navigator, and server applications run on a server, such as Netscape Enterprise Server, both products being available from Netscape Communications Corporation. Using JavaScript, dynamic HTML pages may be created in which the pages process user input and maintain persistent data using special objects, files, and relational databases.
A web page as used herein is a set of instructions for creating a display using a browser. These instructions for web pages may be from pre-existing files or automatically generated by another program. A web page or document may contain both HTML statements and JavaScript statements. Web browsers can interpret client-side JavaScript statements embedded in an HTML page. When the browser on a client requests a web page, the server sends the full content of the document, including HTML and JavaScript statements, to the client. The browser reads the web page from top to bottom, displaying the results of the HTML and executing JavaScript statements as they are encountered in the document.
JavaScript may be used to create or open a new window in addition to the main window in which a document is being presented. With the use of JavaScript, web pages may be processed, causing new windows to be opened without the consent or sometimes even the knowledge of the user. Some pages use these new windows as xe2x80x9cstealth panelsxe2x80x9d, from which advertising may be controlled and which would serve to keep other panels alive even when they have been closed. The use of this feature can cause navigation confusion because each new window has its own history mechanism, and it is usually not obvious when a new window has been opened.
With respect to this problem, state of the art browsers offer a user a choice to enable or disable the use of JavaScript in web pages. Since many web-based applications now require the use of JavaScript, disablement of JavaScript poses a serious inconvenience.
Therefore, it would be advantageous to have an improved method and apparatus for processing web pages to prevent unauthorized opening of windows.
The present invention provides a method and apparatus in a computer for processing a document retrieved from a server connected to the computer by a communications link. A document is retrieved from the server over the communications link. The document is parsed. A determination is made as to whether a command to open a window is present within the document. The window is opened selectively based on a setting.